package main;

import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class Frame {

	JTextArea message;
	JTextField number;
	
	public Frame() {
		JFrame frame = new JFrame("SMSSender");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setLayout(null);
		frame.pack();

		Rectangle captureSize = new Rectangle(Toolkit.getDefaultToolkit()
				.getScreenSize());

		frame.setSize(500, 500);
		frame.setBounds(new Rectangle(captureSize.width - frame.getWidth(),
				captureSize.height - frame.getHeight(), frame.getWidth(), frame
						.getHeight()));
		frame.setVisible(true);
		frame.setAlwaysOnTop(true);

		JLabel jNumber = new JLabel();
		jNumber.setText("Number:");
		jNumber.setBounds(new Rectangle(2, 2, 100, 20));
		frame.add(jNumber);

		number = new JTextField();
		number.setBounds(new Rectangle(102, 2, 300, 20));
		frame.add(number);

		message = new JTextArea();
		message.setBounds(new Rectangle(2, 25, 400, 400));
		frame.add(message);

		JButton send = new JButton("Send");
		send.setBounds(new Rectangle(300, 430, 100, 20));
		send.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			//Main.send(number.getText()+"\n"+message.getText());	
			Main.send(message.getText());
			}
		});
		frame.add(send);

		frame.repaint();
	}

}
